package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.Image;
import business.ImageService;
import dao.ImageDAO;

public class ImageServiceImpl implements ImageService{

	private ImageDAO imageDao;
	
	public List<Image> getAllImages() {
		return imageDao.findAll();
	}
	
	@Required
	public void setImageDao(ImageDAO imageDao) {
		this.imageDao = imageDao;
	}

	@Transactional
	public void addImage(String name) {
		Image e = new Image();
		e.setName(name);
		imageDao.create(e);
	}

	
}